In most MPEG-2 standards (e.g., MPEG-2 Test Model-5, draft revision 2, April 1993), pictures are classified as intra or I pictures, predictive or P pictures, and bi-directionally predictive or B pictures. An ‘I’ picture contains only intra macro-block (MB). A ‘P’ picture may contain inter MB, but only forward directed predictions from a preceding reference picture are permitted. A ‘B’ picture can contain intra MB, inter MB that are forward motion compensated, inter MB that are backward motion compensated, and inter MB that are bidirectionally motion compensated. A group of pictures (GOP) is formed in encoded order starting with an I-picture and ending with the picture before the next I-picture in the sequence.
Each picture is typically divided into non-overlapping MB, where each MB includes a 16×16 array of luminance samples and each block or array of 8×8 chrominance samples overlaid thereon. A decision is made to encode the MB as an inter MB, in which case the MB is both temporally and spatially encoded, or to encode the MB as an intra MB, in which case the MB is only spatially encoded.
Conventional coding techniques generate variable bit-rates for different MB within a picture because different types of MB use variable bits. To transmit the variable rate bit stream in a fixed rate, a ‘virtual buffer’ is provided within an encoder so that the output bits can be controlled by a rate control method. Therefore, the main purpose of the rate control method is to compute the quantization step-size based on the macro-block-level computed ‘virtual buffer’, so as to generate a constant bit rate for targets. To regulate the fluctuation of the coding rate, there is a need to allocate the compressed bit of each frame by choosing a suitable quantization parameter for each MB. The fundamental buffer control strategy adjusts the quantizer scale according to the level of buffer utilization. When the buffer utilization is high, the quantization level should be increased accordingly.
The quantization step-size has direct impact on the number of bits produced at the output of run-length VLC encoding process, and therefore the average output bit rate. It has also a direct impact on the encoding quality, which represents the output picture quality at the corresponding decoder. In general, larger quantization step-size generates lower output bit rate and lower encoding quality. In order to control output bit rate and picture quality so that the resulting bit stream can satisfy channel bandwidth or storage limitation as well as quality requirements, rate control and quantization control methods are used.
The rate control and quantization control for a MPEG-2 video encoder comprises the steps of allocating bit target for each picture and computing MB reference quantization values. A target number of bits for coding a picture is first determined based on target output bit-rate, picture coding type, bit usage, and average quantization step-sizes of past coded pictures. With the determined target number of bits, the reference quantization step-size is calculated for each MB of the picture. This reference quantization step-size is then used for encoding the MB of the picture.
The ‘virtual buffer’ is used to determine the MB reference quantization parameter. Before encoding MB j (j>=1), the fullness of the appropriate virtual buffer (Dj) is first computed. Each of the three picture types has a virtual buffer associated with it and these buffers are updated after coding each MB of the picture type according to Equation 1 below:
                              D          j                =                              D            0                    -                                                    T                pict                                            MB                cnt                                      ⨯                          (                              j                -                1                            )                                +                      B                          j              -              1                                                          (                  Eqn          .                                          ⁢          1                )            
where j is the current MB count; D0 the initial fullness of Virtual Buffer (each I/P/B); MBcnt the total number of MB in a picture; Bj−1 number of bit generated by encoding all MB up to j−1; and Tpict the Target Picture Bits Allocation (Ti/Tp/Tb).
At picture level, D0 is updated as: D0=Dj. The above equation is basically tracking the difference between the actual number of bits used and the target bits allocated, and then this difference is added to the respective virtual buffer.
The MB reference quantization step-size Qj is then computed from the virtual buffer fullness, Dj. This allows the rate controller to control the bits allocation based on consumption pattern of the picture:Qj=(Dj*31)/r  (Eqn. 2)
where r is known as the reactive parameter=2*Bit13 Rate/Picture_Rate.
The reaction parameter is a factor that can control the sensitivity of the method from a change in Dj. Larger r values will cause the reaction to be slower, which may cause the target bits and actual bits to differ significantly. However, larger r values bring about a more gradual rate of change in bits consumption. On the other hand, a small r value causes the controller to be more reactive to changes, giving rise to a closer target and actual bits value.
Thus, in conventional rate controls, to achieve bits used near to the target allocation, the reference Qj is adjusted in every MB according to the bits-used in the previous MBs and the remaining target bits left for the remaining MBs in the picture. As the bits-used for each MB are different, the reference Qj is adjusted up or down, so that the bits-used moves towards the target. This MB reference Qj is not ideal for picture quality as it is reactive to the up-to-date bits-used. To tackle the variation of Qj for each MB in a picture, the prior art provides two-pass method that obtains the actual Qj for each MB first and then calculates the average Qj based on the actual Qj, where the average Qj will be used for quantization of each MB. If the average Qj of the current encoding picture is known using the two-pass method, it would then be more ideal to use it as the reference quantization for the picture so that the closeness of the bits-used to the target would be similar to using the MB-level adjusted reference Qj. However, using two-pass or multi-pass method to determine the ideal reference quantization will result in more complex implementation.
There is therefore a need for MB MB quantization reactivity compensation that generally reduces or compensates the MB level Qj reactivity. In particular, this is a need for a system of predicting the picture average reference Qj and using the picture average reference Qj as the reference picture Qj.